package cd.safe.school.activity;

import org.androidpn.client.ServiceManager;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import cd.safe.school.R;
import cd.safe.school.util.SharedPreUtil;

public class KaiJreciver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		String password = SharedPreUtil.getValue(context, "password",
				"2w2w2w2w");

		// PendingIntent i = PendingIntent.getService(context, 0, new
		// Intent(
		// context, NotificationService.class), 0);
		// long firstTime = SystemClock.elapsedRealtime();
		// AlarmManager am = (AlarmManager) context
		// .getSystemService(Activity.ALARM_SERVICE);
		//
		// am.cancel(i);
		// am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstTime,
		// 100, i);
		if (password != null && !"".equals(password)) {
			// System.out.println("--------------------------");
			ServiceManager serviceManager = new ServiceManager(context);
			serviceManager.setNotificationIcon(R.drawable.notification);
			serviceManager.startService();
		}

	}
}
